<?php
session_set_cookie_params(1800 , '/', '.aaa.com'); 
session_start();

$_TOKEN_KEY = 'rH7/2*Zq^k=SB^tn(z8.h.OVP_(Z&.95';
$_PHPSESSID = $_COOKIE['PHPSESSID'];

$_SITE =  array('www.bbb.com');

foreach($_SITE as $value){?>
<script src="http://<?=$value?>/login.php?PHPSESSID=<?=$_PHPSESSID?>&TOKEN=<?=md5(substr(md5($value.$_PHPSESSID),8,16).$_TOKEN_KEY)?>"></script>
<?php }?>

<?php
//header('location:/');
?>